import http from "@/utils/request";

const url = 'stores'

export async function addStore(data: object): Promise<API.Result> {
    /** 添加店铺信息 */
    return http.post(url, data);
}

export async function updateStoreInfo(data: object): Promise<API.Result> {
    /** 修改店铺信息 */
    return http.put(url, data);
}

export async function getWithdrawalsObj(): Promise<API.Result> {
    /** 获取金额信息 */
    return http.get(`${url}/withdrawals`);
}

export async function getStoresOrders(current = 1, page_size = 10): Promise<API.Result> {
    /** 获取订单列表 */
    return http.get(`${url}/orders`, {params: {current, page_size}});
}


export async function getWithdrawalsData(): Promise<API.Result> {
    /** 获取提现列表 */
    return http.get(`${url}/withdrawals_list`);
}
